package com.aididi.produce;

import com.aididi.dto.OrderDto;
import com.aididi.util.ProducerSendUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.UUID;

/**
 * @description：消息可靠性同步发送
 * @author  ：xuzexiang
 * @date  ： 2021/10/25 13:47
 */
@Component
public class SyncProducer {

    @Autowired
    private ProducerSendUtils producerSendUtils;

    public void send(){
        int delayLevel = 3;
        OrderDto dto = new OrderDto();
        UUID uuid = UUID.randomUUID();
        String id = uuid.toString().replace("-","");
        dto.setId(id);
        dto.setOrderId(id);
        producerSendUtils.sendDayEnd(dto,delayLevel);
    }




}
